{% extends 'customer_dashboard.html' %}

{% block content %}
<div class="card-container" style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; padding: 30px;">

  <!-- 余额查询 -->
  <div class="card" onclick="location.href='{{ url_for('customer.balance') }}'">
    <div class="card-icon"><i class="bi bi-wallet2"></i></div>
    <div class="card-title">余额查询</div>
    <div class="card-desc">查看所有银行卡余额信息</div>
  </div>

  <!-- 交易记录 -->
  <div class="card" onclick="location.href='{{ url_for('customer.transactions') }}'">
    <div class="card-icon"><i class="bi bi-card-list"></i></div>
    <div class="card-title">交易记录</div>
    <div class="card-desc">查看和导出您的历史交易记录</div>
  </div>

  <!-- 交易中心卡片 -->
  <div class="card" style="display: flex; justify-content: space-between; align-items: center;">
    <div style="flex: 1; text-align: center;">
      <div class="card-icon"><i class="bi bi-arrow-left-right"></i></div>
      <div class="card-title">交易中心</div>
      <div class="card-desc">进行存款、取款、转账操作</div>
    </div>
    <div class="btn-group-vertical">
      <button class="btn" onclick="location.href='{{ url_for('customer.deposit') }}'">💰 存款</button>
      <button class="btn" onclick="location.href='{{ url_for('customer.withdraw') }}'">💸 取款</button>
      <button class="btn" onclick="location.href='{{ url_for('customer.transfer') }}'">🔁 转账</button>
    </div>
  </div>

  <!-- 挂失 -->
  <div class="card" onclick="location.href='{{ url_for('customer.report_lost') }}'">
    <div class="card-icon"><i class="bi bi-exclamation-circle"></i></div>
    <div class="card-title">挂失</div>
    <div class="card-desc">银行卡丢失？立即挂失保障安全</div>
  </div>

  <!-- 修改密码卡片 -->
  <div class="card" style="display: flex; justify-content: space-between; align-items: center;">
    <div style="flex: 1; text-align: center;">
      <div class="card-icon"><i class="bi bi-lock-fill"></i></div>
      <div class="card-title">修改密码</div>
      <div class="card-desc">支持已知密码或忘记密码方式</div>
    </div>
    <div class="btn-group-vertical">
      <button class="btn" onclick="location.href='{{ url_for('customer.change_password') }}'">🔐 已知密码</button>
      <button class="btn" onclick="location.href='{{ url_for('customer.forget_password_reset') }}'">🔓 忘记密码</button>
    </div>
  </div>

  <!-- 退出登录 -->
  <div class="card" onclick="location.href='{{ url_for('logout') }}'">
    <div class="card-icon"><i class="bi bi-box-arrow-right"></i></div>
    <div class="card-title">退出登录</div>
    <div class="card-desc">安全退出系统</div>
  </div>

</div>

<style>
  .card {
    background: #fff;
    border-radius: 16px;
    padding: 30px 25px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  }

  .card-icon {
    font-size: 30px;
    margin-bottom: 12px;
    color: #4a90e2;
  }

  .card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
  }

  .card-desc {
    font-size: 14px;
    color: #666;
  }

  .btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .btn {
    padding: 8px 20px;
    background-color: #007bff;
    color: white;
    border-radius: 6px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    min-width: 90px;
  }

  .btn:hover {
    background-color: #0056b3;
  }
</style>
{% endblock %}
